package com.koron.tool.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: laiguangming
 * @Date: 2022/10/28 10:00
 */
@Getter
@AllArgsConstructor
public enum InventoryStatusEnum {

    /**
     * 库存状态：在库
     */
    IN_INVENTORY("in", "在库"),

    /**
     * 库存状态：借出
     */
    NOT_IN_INVENTORY("out", "借出");

    private String value;

    private String description;

    /**
     * 获取枚举的 Map, Entry(value, description)
     * @return
     */
    public static Map<String, String> getMap() {
        Map<String, String> map = new HashMap<>();
        InventoryStatusEnum[] enums = InventoryStatusEnum.values();
        for (InventoryStatusEnum inventoryStatusEnum : enums) {
            map.put(inventoryStatusEnum.getValue(), inventoryStatusEnum.getDescription());
        }
        return map;
    }

}
